home *** CD-ROM | disk | FTP | other *** search
/ Total Web Page (Professional Suite) / Total Web Page 99.iso / CGI / MAILFILE.TAR / README < prev   
Text File  |  1996-07-04  |  7KB  |  138 lines

  1. ##############################################################################
  2. # MailFile                      Version 1.5.1 README                         #
  3. # Modified by Mike Wheeler, mwheeler@gladstone.uoregon.edu                   #
  4. # Available from http://gladstone.uoregon.edu/~mwheeler/cgi                  #
  5. # Based on:                                                                  #
  6. # FormMail                      Version 1.5                                  #
  7. # Copyright 1996 Matt Wright    mattw@misha.net                              #
  8. # Created 6/9/95                Last Modified 2/5/96                         #
  9. # Scripts Archive at:           http://www.worldwidemart.com/scripts/        #
  10. ##############################################################################
  11. # COPYRIGHT NOTICE                                                           #
  12. # Copyright 1996 Matthew M. Wright  All Rights Reserved.                     #
  13. #                                                                            #
  14. # FormMail may be used and modified free of charge by anyone so long as this #
  15. # copyright notice and the comments above remain intact.  By using this      #
  16. # code you agree to indemnify Matthew M. Wright from any liability that      #
  17. # might arise from it's use.                                                 #
  18. #                                                                            #
  19. # Selling the code for this program without prior written consent is         #
  20. # expressly forbidden.  In other words, please ask first before you try and  #
  21. # make money off of my program.                                              #
  22. ##############################################################################
  23. The first line of the script must tell the server where Perl is on the 
  24. server. If you don't know use the command "whereis perl" ata Unix Prompt.
  25. The first line will be something like this:
  26. #! /usr/local/bin/perl
  27. or maybe this:
  28. #! /usr/bin/perl
  29.  
  30. Then you must define the variables in the script. This has many more to 
  31. set than Matt's FormMail script, but you shouldn't have much of a problem 
  32. with this.
  33.  
  34. $mailprog = '/usr/lib/sendmail';
  35. The location of your sendmail program goes here. If you don't know you 
  36. can use the command "whereis sendmail" at a Unix prompt.
  37.  
  38. $newurl = 'http://gladstone.uoregon.edu/~mwheeler/cgi';
  39. If the script runs properly and they entered sufficient information this 
  40. is the url where people requesting files will be sent upon completion of 
  41. the script running.
  42.  
  43. $fromaddr = 'mwheeler@gladstone.uoregon.edu';
  44. This is the e-mail address from which the files will be sent. The script 
  45. will also send e-mail to this address telling you what files the person 
  46. requested as well as any comments the person included with their request.
  47.  
  48.  
  49. $organization = 'University of Oregon';
  50. This is simply whatever organization is sending the files. Your company 
  51. or whatever.
  52.  
  53. $fromname = 'Mike Wheeler';
  54. This is the name of the person (or whatever) the files are being sent from.
  55.  
  56. $filebase = '/ccserver/home23/mwheeler/public_html/cgi';
  57. This is the base path to all files you want sent. There must be no slash 
  58. at the end of this one. If the files are coming from multiple directories 
  59. you must show this in the filename part of the form such as "chat/chat.tar" 
  60.  
  61. $form_letter = "";
  62. This is the file you want sent out with every request for files (it will be 
  63. sent as a seperate message. Leave blank if you don't want one. This
  64. must follow the same rules set by $filebase (if it's in a sub directory 
  65. of the $filebase that directory must also be named for $form_letter. For 
  66. instance if the form letter is in the letters directory in the base 
  67. directory this variable should be set to "letters/form_letter.txt" or 
  68. whatever.
  69.  
  70. @referers = ("gladstone.uoregon.edu");
  71. @referers allows forms to be located only on servers which are defined
  72. in this field.  This fixes a security hole in the last version which
  73. allowed anyone on any server to use your FormMail script.
  74.  
  75. That's it for setting variables within the script. Now you must set the 
  76. permissions for the script. To do this just type "chmod 755 mailfile.cgi" 
  77. at a Unix prompt. Substitute whatever you named the script for mailfile.cgi
  78.  
  79. Now to use this script you must include a form in an html file which 
  80. calls the script. Here is a sample:
  81.  
  82. <form method=post action="mailfile.cgi">
  83. <input type=checkbox name="filename" value="chatpro/chatpro.pl">ChatPro.pl<br>
  84. <input type=checkbox name="filename" value="chatpro/chatpro.tar">ChatPro.tar<br>
  85. Mail: <input type=text name="email" size=40><br>
  86. Name: <input type=text name="realname"><br>
  87. Comments: <textarea rows=4 cols=40 name="comments"></textarea>
  88. <input type=submit value="Send It">
  89. </form>
  90.  
  91. And here is an explanation of the html:
  92.  
  93. <form method=post action="mailfile.cgi">
  94. The action must be set to the url of the script. In this case the page 
  95. with the html is in the smae directory as the script, so I only needed to 
  96. pu the name of the script in.
  97.  
  98. <input type=checkbox name="filename" value="chatpro/chatpro.pl">ChatPro.pl<br>
  99. <input type=checkbox name="filename" value="chatpro/chatpro.tar">ChatPro.tar<br>
  100. These are the files the person is requesting. In this case they are 
  101. checkboxes on the form. All the inputs for files on the form should have 
  102. name set to "filename and value set to the actual name of the file. In 
  103. this case I have them in a subdirectory of my $base_dir so I covered that 
  104. here. If a person doesn't request any files they will be told that they 
  105. need to choose a file and try again.
  106.  
  107. Mail: <input type=text name="email" size=40><br>
  108. This is where the person requesting the files enters their e-mail 
  109. address. If they enter an improperly formatted address or leave this 
  110. blank they will be told they need to correct it and try again.
  111.  
  112. Name: <input type=text name="realname"><br>
  113. This is the name of the person requesting the files. This field isn't 
  114. required.
  115.  
  116. Comments: <textarea rows=4 cols=40 name="comments"></textarea>
  117. This provides an area for the person requesting the files to send 
  118. comments to the owner of the files (set with the $fromaddr variable). 
  119. This field is not required.
  120.  
  121. <input type=submit value="Send It">
  122. This is the submit button so they can send the form to the script.
  123.  
  124. </form>
  125. This is the end of the form on the page.
  126.  
  127. This script is also able to automatically make a form listing every file 
  128. in the $filebase directory. To do that make a link to the script with a 
  129. QUERY_STRING of "archive", something like this:
  130. <a href="http://yourdamin.com/cgi-bin/mailfile.pl?archive">
  131.  
  132. That's all there is to it. There is no limit to the number of files you 
  133. can send someone so long as they follow the guidelines outlined above.
  134.  
  135. Version 1.5.1 added the archiving ability. It also now alerts someone 
  136. when they request a non-existent file and sends mail to the script owner 
  137. saying that file apparently doesn't exist.
  138.